package py.edu.ucsa.sisalews.services.rest.impl;

import java.util.List;

import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;

import py.edu.ucsa.sisalews.config.SisalewsApplicationContextProvider;
import py.edu.ucsa.sisalews.model.services.impl.ModuloServiceImpl;
import py.edu.ucsa.sisalews.persistence.dto.ModuloDTO;
import py.edu.ucsa.sisalews.services.rest.ModuloREST;

public class ModuloRESTImpl implements ModuloREST {

	private ApplicationContext ctx;
	
	@Autowired
	private ModuloServiceImpl moduloService;
	
	public ModuloRESTImpl(){
		ctx = SisalewsApplicationContextProvider.getContext();
	}
	
	@Override
	public List<ModuloDTO> listar() {
		moduloService = (ModuloServiceImpl) ctx.getBean("moduloService");
		return moduloService.listar();
	}

	@Override
	public Response insertar(String modulo) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Response eliminar(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Response modificar(String modulo) {
		// TODO Auto-generated method stub
		return null;
	}
	
	public void setModuloService(ModuloServiceImpl moduloService) {
		this.moduloService = moduloService;
	}

}
